﻿using AutoMapper;
using BS.Domain;
using BS.Domain.Cultivation;
using BS.Domain.ProcessTable;
using BS.Domain.RBAC;
using BS.Domain.Slaughter;
using BS.Domain.traceability;

namespace BS.Write.Api
{
    public class MyMapping:Profile
    {
        public MyMapping()
        {
            //创建映射
            //---------RBAC操作的映射
            CreateMap<UserInfo, LoginUserReponseDTO>().ReverseMap();

            CreateMap<UserInfo, AddUserToRoleCommand>().ReverseMap();

            CreateMap<UserInfo, BackfillUserFromRoleCommand>().ReverseMap();

            CreateMap<UserInfo, RemoveUserFromRoleCommand>().ReverseMap();

            CreateMap<UserInfo, UpdateUserToRoleCommand>().ReverseMap();

            CreateMap<Role, AddRoleToPermissionsCommand>().ReverseMap();
            //----------------溯源操作的映射
            CreateMap<traceabilitable, InsertTranceShuoYuanCommand>().ReverseMap();
            CreateMap<traceabilitable, UpdateTranceShuoYuanCommand>().ReverseMap();
            CreateMap<traceabilitable, DelTranceShuoYuanCommand>().ReverseMap();

            //------------养殖操作的映射
            CreateMap<Breedings, CreateBreedingCommand>().ReverseMap();
            CreateMap<Breedings, DelBreedingCommand>().ReverseMap();
            CreateMap<Breedings, UpdateBreedingCommand>().ReverseMap();

            CreateMap<Imunitys, CreateImunityCommand>().ReverseMap();
            CreateMap<Imunitys, DelImunityByIdCommand>().ReverseMap();
            CreateMap<Imunitys, UpdateImunityCommand>().ReverseMap();

            CreateMap<BreedingEnterprises, CreateBreedingEnterpriseCommand>().ReverseMap();
            //-------------屠宰操作的映射
            CreateMap<Slaughters, InsertSlaughterCommand>().ReverseMap();

            CreateMap<SlaughterEnterprise,AddSlaughterEnterpriseCommand>().ReverseMap();
            //------------深加工操作的映射
            CreateMap<Processing,InsertProcessingCompanyRequestDTO>().ReverseMap();
            //-------------图片的映射
            CreateMap<Pictures, InsertPrictureRequestDTO>().ReverseMap();
        }
    }
}
